package com.surfilter.config;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.MultipartConfigElement;

@Configuration
public class UploadConfig {
    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        //单个文件最大，也可以用KB表示
        factory.setMaxFileSize("20MB");
        //多文件总大小
        factory.setMaxRequestSize("20MB");
        return factory.createMultipartConfig();
    }
}